//
// Created by jack on 2021/2/3.
//

#ifndef WEILACSDK_WEILAPB_SESSIONMSG_H
#define WEILACSDK_WEILAPB_SESSIONMSG_H

#define SERVICE_TYPE_KEY "serviceType"
#define SERVICE_TYPE_LOCATION "location"
#define LOCATION_TYPE_KEY "locationType"
#define LATITUDE_KEY "latitude"
#define LONGITUDE_KEY "longitude"
#define LOCATION_NAME_KEY "name"
#define LOCATION_ADDRESS_KEY "address"
#define SERVICE_TYPE_VIDEO "video"
#define SERVICE_TYPE_FILE "file"
#define FILE_URL_KEY "fileUrl"
#define FILE_SIZE_KEY "fileSize"
#define FILE_NAME_KEY "fileName"
#define SERVICE_TYPE_QR_CODE "qrcode"
#define QR_CODE_NAME_KEY "qrName"
#define QR_CODE_DESC_KEY "qrDesc"
#define QR_CODE_SESSION_TYPE_KEY "qrSessionType"
#define QR_CODE_PEER_ID_KEY "qrPeerId"
#define NORMAL_BUSINESS_SERVICE_TYPE "business"  //通用订单类型
#define DEFAULT_BUSINESS_SERVICE_TYPE "order"    //默认订单类型 打车
#define PTT_FRAME_OPUS_SIZE 2048

#define TEXT_EXTEND_START "&$#@~^@[{:"
#define TEXT_EXTEND_END ":}]&$~@#@"
#define CMD_EXTEND_START "*&^@~^([{:"
#define CMD_EXTEND_END ":}])^*#@#@"

#define FILE_TYPE_DOC "https://weilaavatar.oss-cn-shenzhen.aliyuncs.com/file/DOC.png"
#define FILE_TYPE_HTML "https://weilaavatar.oss-cn-shenzhen.aliyuncs.com/file/HTML.png"
#define FILE_TYPE_MP3 "https://weilaavatar.oss-cn-shenzhen.aliyuncs.com/file/MP3.png"
#define FILE_TYPE_PDF "https://weilaavatar.oss-cn-shenzhen.aliyuncs.com/file/PDF.png"
#define FILE_TYPE_PPT "https://weilaavatar.oss-cn-shenzhen.aliyuncs.com/file/PPT.png"
#define FILE_TYPE_RAR "https://weilaavatar.oss-cn-shenzhen.aliyuncs.com/file/RAR.png"
#define FILE_TYPE_RAW "https://weilaavatar.oss-cn-shenzhen.aliyuncs.com/file/RAW.png"
#define FILE_TYPE_TXT "https://weilaavatar.oss-cn-shenzhen.aliyuncs.com/file/TXT.png"
#define FILE_TYPE_XLS "https://weilaavatar.oss-cn-shenzhen.aliyuncs.com/file/XLS.png"
#define FILE_TYPE_ZIP "https://weilaavatar.oss-cn-shenzhen.aliyuncs.com/file/ZIP.png"
#define FILE_TYPE_WAV "https://weilaavatar.oss-cn-shenzhen.aliyuncs.com/file/WAV.png"
#define FILE_TYPE_VIDEO "https://weilaavatar.oss-cn-shenzhen.aliyuncs.com/file/video.jpg"
#define FILE_TYPE_UNKOWN "https://weilaavatar.oss-cn-shenzhen.aliyuncs.com/file/UNKOWN.png"

enum MsgDataCallbackItem {
    MSGDATA_TEXT_FIELD = 0,
    MSGDATA_AUDIO_DATA_FIELD,
    MSGDATA_AUDIO_URL_FIELD,
    MSGDATA_SWITCH_DATA_FIELD,
    MSGDATA_SERVICE_FIELD,
    MSGDATA_OPUS_DATA_FIELD,
    MSGDATA_TAG_FIELD,
    MSGDATA_FIELD_COUNT
};

typedef struct _PB_EXT_TEXT_DATA {
    PB_UINT16 extDataSize;
    PB_UINT16 msgType;
    void*     pExtData;
} PBExtTextData;

extern PBWeilaMsg*
    weilapb_decodeSessionMsg(PB_INT32 commandId, PB_INT32 commandType, const PB_UINT8* pData, PB_UINT32 dataSize);

#endif  // WEILACSDK_WEILAPB_SESSIONMSG_H
